﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ershou.BLL;

public partial class _Default : System.Web.UI.Page
{
    sp sp1 = new sp();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["mc"]!=null)
        {
            Session["spm"] = Request.QueryString["mc"];
        }
        else
        {
            Session["spm"] = "";
        }
        Bind();
    }

    protected void Bind()
    {
        gvProduct.DataSource = sp1.GetProductByProductIdOrCategoryId(Session["spm"].ToString());
        gvProduct.DataBind();
    }
    protected void gvProduct_PageIndexChanging(Object sender, GridViewPageEventArgs e)
    {
        gvProduct.PageIndex = e.NewPageIndex;
        Bind();  //调用自定义方法Bind()
    }
    protected void gvProduct_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
}